<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>Parallel Gaussian Process Regression: src/pgpr_parse.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Parallel Gaussian Process Regression
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">The implementation of parallel Gaussian process (GP) regression is based on the following publication: Jie Chen, Nannan Cao, Kian Hsiang Low, Ruofei Ouyang, Colin Keng-Yan Tan &amp; Patrick Jaillet. Parallel Gaussian Process Regression with Low-Rank Covariance Matrix Approximations. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI 2013), Bellevue, WA, Jul 11-15, 2013.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">pgpr_parse.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="pgpr__parse_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#ifndef _PGPR_PARSE_H_</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#define _PGPR_PARSE_H_</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__type_8h.html">pgpr_type.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__util_8h.html">pgpr_util.h</a>&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#define DOM 0  // Domain size</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#define INP 1  // Input dimension</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define OUT 2  // Output dimension</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#define MNE 3  // Maximum size of neighbor nodes</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#define HYP 4  // Number of hyper</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#define PARANUM 5 // No. of parameters in first line of cfg file</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#define NAMELEN 128 // Length of a file name</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#define CFGDEMO 1 // Demonstration application </span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#define CFGPREP 2 // Experimental data preparation application</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structt__command__prep.html">   36</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structt__command__prep.html">t_command_prep</a> {</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a157a7013d31723e9e83ee5edd790a9c2">   38</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#a157a7013d31723e9e83ee5edd790a9c2">mode</a>;         </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">   40</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>;             </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="structt__command__prep.html#ae291868f188ef559477de77a0c09b779">   42</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#ae291868f188ef559477de77a0c09b779">mach_num</a>;             </div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a854d30f09e6966153b6aad01be20ba75">   44</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#a854d30f09e6966153b6aad01be20ba75">blk_size</a>;             </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a7c6fcd0ab10f8fb7d1f37209ff4754b3">   46</a></span>&#160;  Char <a class="code" href="structt__command__prep.html#a7c6fcd0ab10f8fb7d1f37209ff4754b3">trainf</a>[NAMELEN];</div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a4b948a1a01c4434772d8b34f91023a3b">   48</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#a4b948a1a01c4434772d8b34f91023a3b">percent</a>;          </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structt__command__prep.html#af2e121153fa801d803b0df9b6a4e6180">   50</a></span>&#160;  Char <a class="code" href="structt__command__prep.html#af2e121153fa801d803b0df9b6a4e6180">testf</a>[NAMELEN];</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structt__command__prep.html#adacbfccb9bc1373a0383aeb7e392f303">   52</a></span>&#160;  Char <a class="code" href="structt__command__prep.html#adacbfccb9bc1373a0383aeb7e392f303">hyperf</a>[NAMELEN];</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structt__command__prep.html#ac4a2e1b1ae951cef4e6a1b75e5e5556d">   54</a></span>&#160;  Int <a class="code" href="structt__command__prep.html#ac4a2e1b1ae951cef4e6a1b75e5e5556d">support</a>;              </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structt__command__prep.html#a19ce353138f10d386cbd54bb9f4edb02">   56</a></span>&#160;  Char <a class="code" href="structt__command__prep.html#a19ce353138f10d386cbd54bb9f4edb02">supportf</a>[NAMELEN];</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;};</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structt__command__demo.html">   64</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structt__command__demo.html">t_command_demo</a> {</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structt__command__demo.html#ac45fbb0d03acb8884ce904e82b82e5bc">   66</a></span>&#160;  Int <a class="code" href="structt__command__demo.html#ac45fbb0d03acb8884ce904e82b82e5bc">mode</a>;                             </div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a26890a40c95b0bcf54cc69b11f802dda">   68</a></span>&#160;  Int <a class="code" href="structt__command__demo.html#a26890a40c95b0bcf54cc69b11f802dda">blocks</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a287322538dd7b8f950eeedba17a9a590">   70</a></span>&#160;  Int <a class="code" href="structt__command__demo.html#a287322538dd7b8f950eeedba17a9a590">rank</a>;</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structt__command__demo.html#af9e6d60a117f951bb76e4d30b9a179a4">   72</a></span>&#160;  Int <a class="code" href="structt__command__demo.html#af9e6d60a117f951bb76e4d30b9a179a4">bandwidth</a>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a5243a68b75cfdcd0787feb1d1a24cdd9">   74</a></span>&#160;  Char <a class="code" href="structt__command__demo.html#a5243a68b75cfdcd0787feb1d1a24cdd9">outf</a>[NAMELEN];       </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a4caa14253026ed57aacca438cd672bb0">   76</a></span>&#160;  Char <a class="code" href="structt__command__demo.html#a4caa14253026ed57aacca438cd672bb0">trainf</a>[NAMELEN]; </div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a84873e5db588a94bca1f35551bf034e4">   78</a></span>&#160;  Char <a class="code" href="structt__command__demo.html#a84873e5db588a94bca1f35551bf034e4">testf</a>[NAMELEN];</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a3b5a4c26250a768829e7e7e3622774dc">   80</a></span>&#160;  Char <a class="code" href="structt__command__demo.html#a3b5a4c26250a768829e7e7e3622774dc">hyperf</a>[NAMELEN]; </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structt__command__demo.html#a2253b0a9e63110ee5b1839122307e678">   82</a></span>&#160;  Char <a class="code" href="structt__command__demo.html#a2253b0a9e63110ee5b1839122307e678">supportf</a>[NAMELEN];   </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;};</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classpgpr__parse.html">   90</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpgpr__parse.html">pgpr_parse</a></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;{</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">   94</a></span>&#160;  <a class="code" href="classpgpr__vector.html">Vdoub</a> <a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">   96</a></span>&#160;  <a class="code" href="classpgpr__vector.html">Vdoub</a> <a class="code" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">v_hyp</a>;  </div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">   99</a></span>&#160;  <a class="code" href="classpgpr__matrix.html">Mdoub</a> <a class="code" href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">m_xyz</a>;  </div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#a24a21542be9a07d290aed66f90997031">  101</a></span>&#160;  Int <a class="code" href="classpgpr__parse.html#a24a21542be9a07d290aed66f90997031">in_dim</a>;</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#ae1fab280bf9c33d950d41f3c962fe8f0">  103</a></span>&#160;  Int <a class="code" href="classpgpr__parse.html#ae1fab280bf9c33d950d41f3c962fe8f0">out_dim</a>;</div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">  106</a></span>&#160;  <a class="code" href="classpgpr__matrix.html">Mint</a>  <a class="code" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">m_connect</a>;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">  108</a></span>&#160;  <a class="code" href="structt__command__demo.html">t_command_demo</a> <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">  111</a></span>&#160;  <a class="code" href="structt__command__prep.html">t_command_prep</a> <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="classpgpr__parse.html#a3e6e01f2423c4a3a48dcd134d0a86385">  120</a></span>&#160;  <a class="code" href="classpgpr__parse.html#a3e6e01f2423c4a3a48dcd134d0a86385">pgpr_parse</a>(Int md, Int argc, Char * argv[]) {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keywordflow">switch</span>(md) {</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="keywordflow">case</span> CFGDEMO:</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;      parse_commandline_demo(argc, argv);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;      <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordflow">case</span> CFGPREP:</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;      parse_commandline_prep(argc, argv);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;      <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;      <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;The commandline is not supported\n&quot;</span>);</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    }</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  }</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <span class="keywordtype">void</span> parse_domfile(Char * file) {</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    FILE * fp;</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    Int ret;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    fp = fopen(file, <span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">if</span>(fp == NULL) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Fail to open file\n&quot;</span>);</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    Int d_xz = (Int)<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[INP] + (Int)<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[OUT];</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <a class="code" href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">m_xyz</a>.resize((Int)<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[DOM], d_xz);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <a class="code" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">m_connect</a>.resize((Int)<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[DOM], (Int)<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[MNE] + 1);</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keywordflow">for</span>(Int i = 0; i &lt; <a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[DOM]; i++) {</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;      <span class="keywordflow">for</span>(Int j = 0; j &lt; d_xz; j++) {</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        Doub tmp;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        ret = fscanf(fp, <span class="stringliteral">&quot;%lf&quot;</span>, &amp;tmp);</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <a class="code" href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">m_xyz</a>[i][j] = tmp;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;      }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;      Int num_ne;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;      ret = fscanf(fp, <span class="stringliteral">&quot;%d&quot;</span>, &amp;num_ne);</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;      <a class="code" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">m_connect</a>[i][0] = num_ne;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;      <span class="keywordflow">for</span>(Int j = 1; j &lt;= num_ne; j++) {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        Int tmp;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        ret = fscanf(fp, <span class="stringliteral">&quot;%d&quot;</span>, &amp;tmp);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        <a class="code" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">m_connect</a>[i][j] = tmp;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;      }</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;      ret = fscanf(fp, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    }</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    fclose(fp);</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  }</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;  </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  <span class="keywordtype">void</span> parse_cfgfile(Char * file) {</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    FILE * fp;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    Int ret;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    fp = fopen(file, <span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keywordflow">if</span>(fp == NULL) {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;      <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Fail to open file\n&quot;</span>);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    }</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="comment">//cofig of the domain data (#parameter is predefined)</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    ret = fscanf(fp, <span class="stringliteral">&quot;dom:&quot;</span>);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordflow">for</span>(Int i = 0; i &lt; PARANUM; i++) {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;      Doub tmp;</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      ret = fscanf(fp, <span class="stringliteral">&quot;%lf&quot;</span>, &amp;tmp);</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;      v_param[i] = tmp;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;%lf &quot;</span>, v_param[i]);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    }</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    ret = fscanf(fp, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="comment">//config of hyper-parameters</span></div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    ret = fscanf(fp, <span class="stringliteral">&quot;hyp: &quot;</span>);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <a class="code" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">v_hyp</a>.resize((Int)v_param[HYP]);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="keywordflow">for</span>(Int i = 0; i &lt; <a class="code" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">v_hyp</a>.size(); i++) {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;      Doub tmp;</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;      ret = fscanf(fp, <span class="stringliteral">&quot;%lf&quot;</span>, &amp;tmp);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;%lf &quot;</span>, tmp);</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;      <a class="code" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">v_hyp</a>[i] = tmp;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    }</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    ret = fscanf(fp, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <a class="code" href="classpgpr__parse.html#a24a21542be9a07d290aed66f90997031">in_dim</a> = (Int)v_param[INP];</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <a class="code" href="classpgpr__parse.html#ae1fab280bf9c33d950d41f3c962fe8f0">out_dim</a> = (Int)v_param[OUT];</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    fclose(fp);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    </div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  Int parse_commandline_prep(Int argc, Char * argv[]) {</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    v_param.resize(PARANUM);</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keywordflow">if</span> (argc &lt; 8) {</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;      pmsg(LEV_PRG, stdout, <span class="stringliteral">&quot;Usage: &lt;app&gt; -dataset &lt;domain&gt; -mode &lt;mode&gt;\</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="stringliteral">-seed &lt;seed&gt; -machine &lt;no. of blocks/machines&gt; -blocksize &lt;size of \</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="stringliteral">each block&gt; -support &lt;size of support set&gt; -percent &lt;percentage of \</span></div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="stringliteral">the domain data used as test set&gt; \n&quot;</span>);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;            <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Number of arguments in commandline is not enough.\n&quot;</span>);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    } <span class="keywordflow">else</span> { <span class="comment">// if we got enough parameters...</span></div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;      Char * data_key;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;      Char dom_file[NAMELEN];</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;      Char cfg_file[NAMELEN];</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;      Char * out_key;</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;      <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; argc; i++) {</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;          <span class="keywordflow">if</span> (i + 1 != argc){</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;              <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-dataset&quot;</span>)) {</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                  data_key = argv[++i];</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;                  sprintf(dom_file, <span class="stringliteral">&quot;%s.%s&quot;</span>, data_key, <span class="stringliteral">&quot;dom&quot;</span>);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;                  sprintf(cfg_file, <span class="stringliteral">&quot;%s.%s&quot;</span>, data_key, <span class="stringliteral">&quot;cfg&quot;</span>);</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;config:%s\n&quot;</span>, cfg_file);</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;domain:%s\n&quot;</span>, dom_file);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;              }<span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-seed&quot;</span>)) {</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;                  SRAND(<a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>);</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;random seed:%d\n&quot;</span>, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-output&quot;</span>)) {</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;                  out_key = argv[++i];</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-mode&quot;</span>)) {</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a157a7013d31723e9e83ee5edd790a9c2">mode</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-machine&quot;</span>)) {</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#ae291868f188ef559477de77a0c09b779">mach_num</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-blocksize&quot;</span>)) {</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a854d30f09e6966153b6aad01be20ba75">blk_size</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-support&quot;</span>)) {</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#ac4a2e1b1ae951cef4e6a1b75e5e5556d">support</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-percent&quot;</span>)) {</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                  <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a4b948a1a01c4434772d8b34f91023a3b">percent</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;              } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                  <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Invalid arguments.\n&quot;</span>);</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;              }</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;          }</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;      }</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;      parse_cfgfile(cfg_file);</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;      parse_domfile(dom_file);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;      sprintf(<a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a7c6fcd0ab10f8fb7d1f37209ff4754b3">trainf</a>, <span class="stringliteral">&quot;%s.%d.%s&quot;</span>, out_key, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>, <span class="stringliteral">&quot;trn&quot;</span>);</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      sprintf(<a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#af2e121153fa801d803b0df9b6a4e6180">testf</a>, <span class="stringliteral">&quot;%s.%d.%s&quot;</span>, out_key, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>, <span class="stringliteral">&quot;tst&quot;</span>);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;      sprintf(<a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a19ce353138f10d386cbd54bb9f4edb02">supportf</a>, <span class="stringliteral">&quot;%s.%d.%s&quot;</span>, out_key, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">seed</a>, <span class="stringliteral">&quot;spt&quot;</span>);</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;      sprintf(<a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#adacbfccb9bc1373a0383aeb7e392f303">hyperf</a>, <span class="stringliteral">&quot;%s.%s&quot;</span>, out_key, <span class="stringliteral">&quot;hyp&quot;</span>);</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;training data:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a7c6fcd0ab10f8fb7d1f37209ff4754b3">trainf</a>);</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;test data:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#af2e121153fa801d803b0df9b6a4e6180">testf</a>);</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;support set:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#a19ce353138f10d386cbd54bb9f4edb02">supportf</a>);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;      pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;hyperparameter:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">param_prep</a>.<a class="code" href="structt__command__prep.html#adacbfccb9bc1373a0383aeb7e392f303">hyperf</a>);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    }</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;  }</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160; </div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;  Int parse_commandline_demo(Int argc, Char * argv[]) {</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    v_param.resize(PARANUM);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="keywordflow">if</span> (argc &lt; 2) {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;      pmsg(LEV_PRG, stdout, <span class="stringliteral">&quot;Usage: &lt;app&gt; -hyper &lt;hyperparameters file&gt; -in\</span></div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;<span class="stringliteral">&lt;an experimental case&gt; -out &lt;output file&gt; -blocks &lt;no. of blocks&gt; -rank\</span></div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;<span class="stringliteral">&lt;reduced rank&gt; \n&quot;</span>);</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;            <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Number of arguments in commandline is not enough.\n&quot;</span>);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    } <span class="keywordflow">else</span> { <span class="comment">// if we got enough parameters...</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;      Char * data_key;</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;      Char dom_file[NAMELEN];</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;      Char cfg_file[NAMELEN];</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;      Char * in_key;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; argc; i++) {</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;          <span class="keywordflow">if</span> (i + 1 != argc){</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;              <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-hyper&quot;</span>)) {</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                  data_key = argv[++i];</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                  sprintf(<a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a3b5a4c26250a768829e7e7e3622774dc">hyperf</a>, <span class="stringliteral">&quot;%s&quot;</span>, data_key);</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-in&quot;</span>)) {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;                  in_key = argv[++i];</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;                  sprintf(<a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a4caa14253026ed57aacca438cd672bb0">trainf</a>, <span class="stringliteral">&quot;%s.trn&quot;</span>, in_key);</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;                  sprintf(<a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a84873e5db588a94bca1f35551bf034e4">testf</a>, <span class="stringliteral">&quot;%s.tst&quot;</span>, in_key);</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;                  sprintf(<a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a2253b0a9e63110ee5b1839122307e678">supportf</a>, <span class="stringliteral">&quot;%s.spt&quot;</span>, in_key);</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;input:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a4caa14253026ed57aacca438cd672bb0">trainf</a>);</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;input:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a84873e5db588a94bca1f35551bf034e4">testf</a>);</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                  pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;input:%s\n&quot;</span>, <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a2253b0a9e63110ee5b1839122307e678">supportf</a>);</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-out&quot;</span>)) {</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;                  Char *out_key = argv[++i];</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;                  sprintf(<a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a5243a68b75cfdcd0787feb1d1a24cdd9">outf</a>, <span class="stringliteral">&quot;%s.rst&quot;</span>, out_key);</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-blocks&quot;</span>)) {</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;                  <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a26890a40c95b0bcf54cc69b11f802dda">blocks</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-rank&quot;</span>)) {</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;                  <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#a287322538dd7b8f950eeedba17a9a590">rank</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;              } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!strcmp(argv[i] , <span class="stringliteral">&quot;-bandwidth&quot;</span>)) {</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;                  <a class="code" href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">param_demo</a>.<a class="code" href="structt__command__demo.html#af9e6d60a117f951bb76e4d30b9a179a4">bandwidth</a> = atoi(argv[++i]);</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;              } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;                  <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;Invalid arguments.\n&quot;</span>);</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;              }</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;          }</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;      }</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    }</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;  }</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;};</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="structt__command__prep_html_af2e121153fa801d803b0df9b6a4e6180"><div class="ttname"><a href="structt__command__prep.html#af2e121153fa801d803b0df9b6a4e6180">t_command_prep::testf</a></div><div class="ttdeci">Char testf[NAMELEN]</div><div class="ttdoc">File containing the test set. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:50</div></div>
<div class="ttc" id="structt__command__demo_html_a84873e5db588a94bca1f35551bf034e4"><div class="ttname"><a href="structt__command__demo.html#a84873e5db588a94bca1f35551bf034e4">t_command_demo::testf</a></div><div class="ttdeci">Char testf[NAMELEN]</div><div class="ttdoc">File containing the test set. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:78</div></div>
<div class="ttc" id="classpgpr__parse_html_ae1fab280bf9c33d950d41f3c962fe8f0"><div class="ttname"><a href="classpgpr__parse.html#ae1fab280bf9c33d950d41f3c962fe8f0">pgpr_parse::out_dim</a></div><div class="ttdeci">Int out_dim</div><div class="ttdoc">Dimension of outputs. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:103</div></div>
<div class="ttc" id="structt__command__demo_html"><div class="ttname"><a href="structt__command__demo.html">t_command_demo</a></div><div class="ttdoc">Information parsed from commandline of application that demonstrates the regression algorithms...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:64</div></div>
<div class="ttc" id="structt__command__demo_html_a2253b0a9e63110ee5b1839122307e678"><div class="ttname"><a href="structt__command__demo.html#a2253b0a9e63110ee5b1839122307e678">t_command_demo::supportf</a></div><div class="ttdeci">Char supportf[NAMELEN]</div><div class="ttdoc">File containing the support set (used by PITC/pPITC/PIC/pPIC) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:82</div></div>
<div class="ttc" id="structt__command__prep_html"><div class="ttname"><a href="structt__command__prep.html">t_command_prep</a></div><div class="ttdoc">Information parsed from commandline of application that prepares the experimental data...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:36</div></div>
<div class="ttc" id="structt__command__prep_html_ae291868f188ef559477de77a0c09b779"><div class="ttname"><a href="structt__command__prep.html#ae291868f188ef559477de77a0c09b779">t_command_prep::mach_num</a></div><div class="ttdeci">Int mach_num</div><div class="ttdoc">No. of blocks/machines. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:42</div></div>
<div class="ttc" id="structt__command__prep_html_a19ce353138f10d386cbd54bb9f4edb02"><div class="ttname"><a href="structt__command__prep.html#a19ce353138f10d386cbd54bb9f4edb02">t_command_prep::supportf</a></div><div class="ttdeci">Char supportf[NAMELEN]</div><div class="ttdoc">File containing the support set (used by PITC/pPITC/PIC/pPIC) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:56</div></div>
<div class="ttc" id="structt__command__prep_html_ac4a2e1b1ae951cef4e6a1b75e5e5556d"><div class="ttname"><a href="structt__command__prep.html#ac4a2e1b1ae951cef4e6a1b75e5e5556d">t_command_prep::support</a></div><div class="ttdeci">Int support</div><div class="ttdoc">Size of support set. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:54</div></div>
<div class="ttc" id="structt__command__demo_html_a3b5a4c26250a768829e7e7e3622774dc"><div class="ttname"><a href="structt__command__demo.html#a3b5a4c26250a768829e7e7e3622774dc">t_command_demo::hyperf</a></div><div class="ttdeci">Char hyperf[NAMELEN]</div><div class="ttdoc">File containing the hyperparameters. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:80</div></div>
<div class="ttc" id="structt__command__demo_html_a4caa14253026ed57aacca438cd672bb0"><div class="ttname"><a href="structt__command__demo.html#a4caa14253026ed57aacca438cd672bb0">t_command_demo::trainf</a></div><div class="ttdeci">Char trainf[NAMELEN]</div><div class="ttdoc">File containing the training data. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:76</div></div>
<div class="ttc" id="structt__command__demo_html_a287322538dd7b8f950eeedba17a9a590"><div class="ttname"><a href="structt__command__demo.html#a287322538dd7b8f950eeedba17a9a590">t_command_demo::rank</a></div><div class="ttdeci">Int rank</div><div class="ttdoc">Size of the reduced rank (used by PICF-based GP) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:70</div></div>
<div class="ttc" id="pgpr__type_8h_html"><div class="ttname"><a href="pgpr__type_8h.html">pgpr_type.h</a></div><div class="ttdoc">This file provides important macros, templates, basic data types (e.g., vector, matrix). </div></div>
<div class="ttc" id="classpgpr__parse_html_aa2dc5cb24f1a14e11db04e129c070697"><div class="ttname"><a href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">pgpr_parse::v_param</a></div><div class="ttdeci">Vdoub v_param</div><div class="ttdoc">Vector of parameters loaded from cfg file. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:94</div></div>
<div class="ttc" id="classpgpr__parse_html_a86c109ef49507a1be375201d0ac4af8e"><div class="ttname"><a href="classpgpr__parse.html#a86c109ef49507a1be375201d0ac4af8e">pgpr_parse::param_prep</a></div><div class="ttdeci">t_command_prep param_prep</div><div class="ttdoc">Information extracted from the commandline of experimental data preparing application. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:111</div></div>
<div class="ttc" id="classpgpr__parse_html"><div class="ttname"><a href="classpgpr__parse.html">pgpr_parse</a></div><div class="ttdoc">This class parses domain data files, configuration file and commandline of different applications...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:90</div></div>
<div class="ttc" id="classpgpr__vector_html"><div class="ttname"><a href="classpgpr__vector.html">pgpr_vector&lt; Doub &gt;</a></div></div>
<div class="ttc" id="structt__command__demo_html_af9e6d60a117f951bb76e4d30b9a179a4"><div class="ttname"><a href="structt__command__demo.html#af9e6d60a117f951bb76e4d30b9a179a4">t_command_demo::bandwidth</a></div><div class="ttdeci">Int bandwidth</div><div class="ttdoc">The bandwidth (used by LMA/pLMA) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:72</div></div>
<div class="ttc" id="classpgpr__parse_html_a1e1b0be13a510fd547620a8971874407"><div class="ttname"><a href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">pgpr_parse::m_connect</a></div><div class="ttdeci">Mint m_connect</div><div class="ttdoc">Connectivity of the domain data: each row stores the indices of a set of data points that connects to...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:106</div></div>
<div class="ttc" id="pgpr__util_8h_html"><div class="ttname"><a href="pgpr__util_8h.html">pgpr_util.h</a></div><div class="ttdoc">This file contains a collection of useful functions such as macro-like inline functions, debug functions, exception handling, file I/O, and a real-time timer class. </div></div>
<div class="ttc" id="classpgpr__parse_html_a24a21542be9a07d290aed66f90997031"><div class="ttname"><a href="classpgpr__parse.html#a24a21542be9a07d290aed66f90997031">pgpr_parse::in_dim</a></div><div class="ttdeci">Int in_dim</div><div class="ttdoc">Dimension of inputs. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:101</div></div>
<div class="ttc" id="structt__command__prep_html_a7c6fcd0ab10f8fb7d1f37209ff4754b3"><div class="ttname"><a href="structt__command__prep.html#a7c6fcd0ab10f8fb7d1f37209ff4754b3">t_command_prep::trainf</a></div><div class="ttdeci">Char trainf[NAMELEN]</div><div class="ttdoc">File containing the training data. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:46</div></div>
<div class="ttc" id="structt__command__prep_html_a5ea7d62fa1431439c77ff1be76a2803b"><div class="ttname"><a href="structt__command__prep.html#a5ea7d62fa1431439c77ff1be76a2803b">t_command_prep::seed</a></div><div class="ttdeci">Int seed</div><div class="ttdoc">Random seed. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:40</div></div>
<div class="ttc" id="structt__command__prep_html_a157a7013d31723e9e83ee5edd790a9c2"><div class="ttname"><a href="structt__command__prep.html#a157a7013d31723e9e83ee5edd790a9c2">t_command_prep::mode</a></div><div class="ttdeci">Int mode</div><div class="ttdoc">Running mode of program. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:38</div></div>
<div class="ttc" id="structt__command__prep_html_adacbfccb9bc1373a0383aeb7e392f303"><div class="ttname"><a href="structt__command__prep.html#adacbfccb9bc1373a0383aeb7e392f303">t_command_prep::hyperf</a></div><div class="ttdeci">Char hyperf[NAMELEN]</div><div class="ttdoc">File containing the hyperparameters. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:52</div></div>
<div class="ttc" id="classpgpr__parse_html_ace1bdb63deaf2a5c680613c33cfc625e"><div class="ttname"><a href="classpgpr__parse.html#ace1bdb63deaf2a5c680613c33cfc625e">pgpr_parse::param_demo</a></div><div class="ttdeci">t_command_demo param_demo</div><div class="ttdoc">Information extracted from the commandline of a demo application. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:108</div></div>
<div class="ttc" id="structt__command__demo_html_a5243a68b75cfdcd0787feb1d1a24cdd9"><div class="ttname"><a href="structt__command__demo.html#a5243a68b75cfdcd0787feb1d1a24cdd9">t_command_demo::outf</a></div><div class="ttdeci">Char outf[NAMELEN]</div><div class="ttdoc">File containing the results. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:74</div></div>
<div class="ttc" id="classpgpr__matrix_html"><div class="ttname"><a href="classpgpr__matrix.html">pgpr_matrix&lt; Doub &gt;</a></div></div>
<div class="ttc" id="structt__command__demo_html_ac45fbb0d03acb8884ce904e82b82e5bc"><div class="ttname"><a href="structt__command__demo.html#ac45fbb0d03acb8884ce904e82b82e5bc">t_command_demo::mode</a></div><div class="ttdeci">Int mode</div><div class="ttdoc">Running mode (reserved) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:66</div></div>
<div class="ttc" id="structt__command__demo_html_a26890a40c95b0bcf54cc69b11f802dda"><div class="ttname"><a href="structt__command__demo.html#a26890a40c95b0bcf54cc69b11f802dda">t_command_demo::blocks</a></div><div class="ttdeci">Int blocks</div><div class="ttdoc">Number of data blocks (used by PITC/pPITC/PIC/pPIC) </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:68</div></div>
<div class="ttc" id="classpgpr__parse_html_afca0013fbaf5205abef333d22f0bcdf4"><div class="ttname"><a href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">pgpr_parse::v_hyp</a></div><div class="ttdeci">Vdoub v_hyp</div><div class="ttdoc">Vector of hyperparameters loaded from cfg file. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:96</div></div>
<div class="ttc" id="classpgpr__parse_html_ad68cc51bfd6c7c8193039f51b641e01d"><div class="ttname"><a href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">pgpr_parse::m_xyz</a></div><div class="ttdeci">Mdoub m_xyz</div><div class="ttdoc">Matrix storing domain data where no. of rows indicates the size of domain and no. of columns is the d...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:99</div></div>
<div class="ttc" id="structt__command__prep_html_a4b948a1a01c4434772d8b34f91023a3b"><div class="ttname"><a href="structt__command__prep.html#a4b948a1a01c4434772d8b34f91023a3b">t_command_prep::percent</a></div><div class="ttdeci">Int percent</div><div class="ttdoc">Percentage of domain inputs used for testing. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:48</div></div>
<div class="ttc" id="classpgpr__parse_html_a3e6e01f2423c4a3a48dcd134d0a86385"><div class="ttname"><a href="classpgpr__parse.html#a3e6e01f2423c4a3a48dcd134d0a86385">pgpr_parse::pgpr_parse</a></div><div class="ttdeci">pgpr_parse(Int md, Int argc, Char *argv[])</div><div class="ttdoc">Construction function. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:120</div></div>
<div class="ttc" id="structt__command__prep_html_a854d30f09e6966153b6aad01be20ba75"><div class="ttname"><a href="structt__command__prep.html#a854d30f09e6966153b6aad01be20ba75">t_command_prep::blk_size</a></div><div class="ttdeci">Int blk_size</div><div class="ttdoc">Data size in each block/machine. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:44</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 5 2015 14:32:10 for Parallel Gaussian Process Regression by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>
